﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace RolePlaying
{
    public class Tools
    {
        public static string MovePadTexture { get; set; }
        
        public static bool IsAlt { get; set; }
        public static int GetNumberOfFrames(Texture2D tex)
        {
            if (tex != null)
            {
                if (tex.Width == tex.Height) return 1;

                if (tex.Width % tex.Height == 0)
                {
                    return tex.Width / tex.Height;
                }
            }

            return 1;
        }

        public static Point GetFrameDimensions(Texture2D tex)
        {
            int noofframes = GetNumberOfFrames(tex);

            if (noofframes == 1) return new Point(tex.Width, tex.Height);

            return new Point(tex.Height, tex.Height);
        }

        public static Color GetColor(string colorName)
        {
            switch (colorName)
            {
                case "WHITE":
                    {
                        return Color.White;
                    }
                case "BLUE":
                    {
                        return Color.Blue;
                    }
                case "RED":
                    {
                        return Color.Red;
                    }
                case "GREEN":
                    {
                        return Color.Green;
                    }
                case "YELOOW":
                    {
                        return Color.Yellow;
                    }
                default:
                    {
                        return Color.White;
                    }
            }

            return Color.White;
        }




    }
}
